/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package clientprogram;

import java.awt.AWTException;
import java.awt.Component;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.Console;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;

/**
 *
 * @author ASUS
 */
public class ClientProgram {

    /**
     * @param args the command line arguments
     */
    User user;
    LoginForm loginForm;
    LockScreen lookScreen;
    ClientMain clientMain;
    
    public ClientProgram() throws IOException
    {
        InitConnection();
        ShowLockScreen();
    }
    
    public void InitConnection()
    {
        
    }
    
    public void ScreenCapture()
    {
        Robot robot;
        try {
            robot = new Robot();
            BufferedImage screenShot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
            try {
                ImageIO.write(screenShot, "JPG", new File("screenShot.jpg"));
            } catch (IOException ex) {
                Logger.getLogger(ClientProgram.class.getName()).log(Level.SEVERE, null, ex);
            }
        } catch (AWTException ex) {
            Logger.getLogger(ClientProgram.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    @SuppressWarnings("empty-statement")
    public void ShowLockScreen() throws IOException
    {
        new LockScreen();
    }
    
    public void Shutdown() throws IOException
    {
        Runtime runtime = Runtime.getRuntime();
	Process proc = runtime.exec("shutdown -s -t 0");
	System.exit(0);
    }
    
    public static void main(String[] args) throws Exception {
        // TODO code application logic here
        ClientProgram client = new ClientProgram();
        //System.out.println(new File(".").getAbsolutePath());
        /*
        Scanner scan = new Scanner(System.in);
        System.out.print("Enter command:");
        int cmdID = scan.nextInt();
        switch (cmdID){
            case 0: //Shutdown computer
                client.Shutdown();
                break;
            case 1: //Capture screen
                client.ScreenCapture();
                break;
            case 2:
                client.ShowLockScreen();
                break;
            default:
                ///
        }*/
        
    }
    
}
